/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.kallsonys.object;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author alladiab
 */
@Entity
@Table(name = "SHIPPINGCOMPANY")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Shippingcompany.findAll", query = "SELECT s FROM Shippingcompany s"),
    @NamedQuery(name = "Shippingcompany.findByShippingcompanyid", query = "SELECT s FROM Shippingcompany s WHERE s.shippingcompanyid = :shippingcompanyid"),
    @NamedQuery(name = "Shippingcompany.findByShippingcompanyname", query = "SELECT s FROM Shippingcompany s WHERE s.shippingcompanyname = :shippingcompanyname"),
    @NamedQuery(name = "Shippingcompany.findByShippingcompanyurl", query = "SELECT s FROM Shippingcompany s WHERE s.shippingcompanyurl = :shippingcompanyurl")})
public class Shippingcompany implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "SHIPPINGCOMPANYID")
    private BigDecimal shippingcompanyid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "SHIPPINGCOMPANYNAME")
    private String shippingcompanyname;
    @Size(max = 200)
    @Column(name = "SHIPPINGCOMPANYURL")
    private String shippingcompanyurl;
    @OneToMany(mappedBy = "shippingcompanyid")
    private List<OrderOms> orderOmsList;

    public Shippingcompany() {
    }

    public Shippingcompany(BigDecimal shippingcompanyid) {
        this.shippingcompanyid = shippingcompanyid;
    }

    public Shippingcompany(BigDecimal shippingcompanyid, String shippingcompanyname) {
        this.shippingcompanyid = shippingcompanyid;
        this.shippingcompanyname = shippingcompanyname;
    }

    public BigDecimal getShippingcompanyid() {
        return shippingcompanyid;
    }

    public void setShippingcompanyid(BigDecimal shippingcompanyid) {
        this.shippingcompanyid = shippingcompanyid;
    }

    public String getShippingcompanyname() {
        return shippingcompanyname;
    }

    public void setShippingcompanyname(String shippingcompanyname) {
        this.shippingcompanyname = shippingcompanyname;
    }

    public String getShippingcompanyurl() {
        return shippingcompanyurl;
    }

    public void setShippingcompanyurl(String shippingcompanyurl) {
        this.shippingcompanyurl = shippingcompanyurl;
    }

    @XmlTransient
    public List<OrderOms> getOrderOmsList() {
        return orderOmsList;
    }

    public void setOrderOmsList(List<OrderOms> orderOmsList) {
        this.orderOmsList = orderOmsList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (shippingcompanyid != null ? shippingcompanyid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Shippingcompany)) {
            return false;
        }
        Shippingcompany other = (Shippingcompany) object;
        if ((this.shippingcompanyid == null && other.shippingcompanyid != null) || (this.shippingcompanyid != null && !this.shippingcompanyid.equals(other.shippingcompanyid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return shippingcompanyname;
    }
    
}
